import React from "react"
import { useRoutes, Routes, Route } from "react-router-dom";
import Header from './component/header'
import routes from './route'
// import './app.css'

function routerRender(routes) {
  return routes.map(route => <Route key={route.key} {...route}>
    {route.children ? routerRender(route.children) : null}
  </Route>)
}
export default function App() {
  return <React.Fragment>
    <Header />
    {useRoutes(routes)}

    {/* <Routes> {routerRender(routes)} </Routes> */}
  </React.Fragment>
}
